<template>
  <div>
    父子组件传值
    <children :msg="msg" :foo="foo" @event-to-parent="eventToParent"/>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue';
import children from './components/children.vue';

let msg = ref('hello word');
let foo = ref(10);

// 接收子组件传递过来的值
let eventToParent = (val: string) => {
  console.log(val); // output => 子组件传递给父组件的值
}
</script>

<style scoped>

</style>